unit ufrmContrasenias;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, cxGraphics, cxControls, cxEdit, Data.DB,
  cxContainer, Vcl.ImgList, dxBar, Datasnap.DBClient,
  cxTextEdit, cxClasses, dxRibbon, cxGridLevel, cxGridCustomTableView,
  cxGridTableView, cxGridDBTableView, cxGridCustomView, cxGrid, cxLookAndFeels,
  cxLookAndFeelPainters, cxStyles, dxSkinsCore, dxSkinOffice2007Blue,
  dxSkinscxPCPainter, cxCustomData, cxFilter, cxData, cxDataStorage,
  cxNavigator, cxDBData, dxRibbonSkins, dxSkinsdxRibbonPainter,
  dxSkinsdxBarPainter;

type
  TfrmContrasenias = class(TForm)
    cxGrid1DBTableView1: TcxGridDBTableView;
    cxGrid1Level1: TcxGridLevel;
    cxGrid1: TcxGrid;
    cxGrid1DBTableView1UCUSERNAME: TcxGridDBColumn;
    cxGrid1DBTableView1UCLOGIN: TcxGridDBColumn;
    cxGrid1DBTableView1UCEMAIL: TcxGridDBColumn;
    cxGrid1DBTableView1CONTRASENIA: TcxGridDBColumn;
    dxRibbon1: TdxRibbon;
    dxRibbon1Tab1: TdxRibbonTab;
    dxBarManager1: TdxBarManager;
    dxBarManager1Bar1: TdxBar;
    dxBarLargeButton1: TdxBarLargeButton;
    ImageList16: TcxImageList;
    ImageList32: TcxImageList;
    txtFiltro: TcxTextEdit;
    procedure FormShow(Sender: TObject);
    procedure dxBarLargeButton1Click(Sender: TObject);
    procedure txtFiltroKeyUp(Sender: TObject; var Key: Word;
      Shift: TShiftState);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmContrasenias: TfrmContrasenias;

implementation

uses
  udmDataAdmin;

{$R *.dfm}

procedure TfrmContrasenias.dxBarLargeButton1Click(Sender: TObject);
begin
  dmData.Exportar(cxGrid1);
end;

procedure TfrmContrasenias.FormShow(Sender: TObject);
begin
  Screen.Cursor := crHourglass;
  try
    dmData.cdsUsuarios.Open;
  finally
    Screen.Cursor := crDefault;
  end;
end;

procedure TfrmContrasenias.txtFiltroKeyUp(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if 'UCUSERNAME'<>EmptyStr then
    dmData.cdsUsuarios.Filter:= 'UPPER(' + 'UCUSERNAME' + ') like ''%' +
      UpperCase(txtFiltro.Text) + '%''';
end;

initialization
  RegisterClass(TfrmContrasenias);

end.
